<?php
namespace app\admin\model;

use think\Model;

class Common extends Model
{
    public function tree($page=1,$limit=10)
    {

        $dataList = $this->cModel->page($page,$limit)->select();
        return layJson($dataList);
        return json($dataList);
        $this->result($res,0,'请求成功！','json');
    }

    /**
     * 直接返回layUI分页表格所需是数据
     *
     * @param int $page 页码
     * @param int $limit 每页显示条数
     * @return \think\response\Json
     */
    public function pageTable($page=1,$limit=10)
    {
        return json([
            'code'=>0,
            'msg'=>'查询成功',
            'count'=>self::count(),
            'data'=>self::page($page,$limit)->select()
        ]);
    }
}